package strategy.myself.payPort;


import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class StrategyContenx {
    static Map<String, Pay> stategy =new ConcurrentHashMap<>();

    public static  final String ALI_PAY = "AliPay";
    public static  final String WECHAT_PAY = "WechatPay";
    public static  final String UNION_PAY = "UnionPay";
    public static  final String DEFAULT_PAY = ALI_PAY;
    static {
        stategy.put(ALI_PAY,new AliPay());
        stategy.put(WECHAT_PAY,new WeChatPay());
        stategy.put(UNION_PAY,new UnionPay());
    }

    static public String [] getPaySet(){
        return  stategy.keySet().toArray(new String[0]);
    }

    static public Pay getPay(String payKey){
        return stategy.get(payKey);
    }
}
